package dao.impl;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;

import po.User;
import dao.UserDao;
@Repository
public class UserDaoImpl implements UserDao {
	@PersistenceContext(name="em")
	private EntityManager em;
	@Override
	public void addUser(User u) {
		em.persist(u);
	}
	public List<User> findAll(){
		return em.createQuery("from User").getResultList();
	}

}
